﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using DotSpatial.Topology;


namespace NSCore
{
    public class MathReceptor
    {
        public MathReceptor(Coordinate coord)
        {
           

            this._coord = coord;

            this._contributeValue =null;

 
        }


        


        Coordinate _coord;

        public Coordinate Coord
        {
            get { return _coord; }
            set { _coord = value; }
        }


        double? _contributeValue;

        public double? ContributeValue
        {
            get { return _contributeValue; }
            
        }



        /// <summary>
        /// 通过这个函数，用来叠加贡献值的声压级
        /// </summary>
        /// <param name="nlevel"></param>
        public void AddContribueNL(double nlevel)
        {


            //如果是第一次

            if (this._contributeValue == null)
            {

                this._contributeValue = nlevel;


                return;


            }


            else
            {
                //使用叠加算法

                double d = (double)this._contributeValue;

                this._contributeValue = NSMathHelper.ADDNoiseLevel(d,nlevel);


            }

        







        }




    }
}
